<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>计算属性</title>
    <script src="../vue.js"></script>
  </head>
  <body>
    <div id="app">
      <p>{{ gettime()}}</p>
      <p>{{ gettime1}}</p>
    </div>
    <script>
      var vm = new Vue({
        el: "#app",
        data: {},
        methods: {
          gettime() {
            return Date.now();
          },
        },
        computed: {
          gettime1: function () {
            return Date.now();
          },
        },
      });
    </script>
  </body>
</html>
